package com.woniuxy01;

import java.util.Date;

class FatherClass{

    static{
        System.out.println("FatherClass静态代码块,加载父类代码："+new Date());
    }

    {
        System.out.println("FatherClass非静态代码块,开始创建父类对象："+new Date());
    }

    public FatherClass() {
        System.out.println("FatherClass构造方法,给父类属性赋值");
    }
}

class SonClass extends FatherClass{

    static{
        System.out.println("SonClass静态代码块，加载子类代码:"+new Date());
    }

    {
        System.out.println("SonClass非静态代码块,开始创建子类对象："+new Date());
    }

    public SonClass() {
        System.out.println("SonClass构造方法，给子类属性赋值");
    }

    public SonClass(int x) {
        System.out.println("SonClass构造方法，给子类属性赋值");
    }
}

public class Test04 {
    public static void main(String[] args) {
       SonClass son1 = new SonClass();
       SonClass son2 = new SonClass();

    }
}
